﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CustomsNuke.Engine.Data;

namespace CustomsNuke.Engine.Security
{
    public class SecurityUtility
    {
        private static CustomsNukeContext _context = new CustomsNukeContext();
        public static int ValidateUser(string username, string password)
        {
            int iRet = 0;

            var currUser = _context.User.FirstOrDefault(x=>x.UserName == username && x.Password == password);
            if (currUser != null && currUser.Id > 0)
            {
                iRet = currUser.Id;
            }

            return iRet;
        }
    }
}
